#include "strmsg.h"
#include <string.h>
#include <stdio.h>


/*
 * Implementación de la función pseudoTrans, de la librería
 * strmsg.h
 * Recibe un comando, lo compara de forma exhaustiva con los comandos
 * disponibles, y devuelve su equivalente en español.
 */
void pseudoTrans(char command[],char resul[]){	
	if(strncasecmp(command,"conectar",8)==0)
		sprintf(resul,"%s %s","open",&command[9]);
	else if(strncasecmp(command,"usuario",7)==0){
		sprintf(resul,"%s %s","user",&command[8]);			
	}
	else if(strncasecmp(command,"clave",5)==0){
		sprintf(resul,"%s %s","pass",&command[6]);
		}
	else if(strncasecmp(command,"actual",6)==0)
		sprintf(resul,"%s %s","pwd",&command[7]);
	else if(strncasecmp(command,"mostrar",7)==0)
		sprintf(resul,"%s %s","list",&command[8]);
	else if(strncasecmp(command,"subir",5)==0)
		sprintf(resul,"%s %s","put ",&command[6]);
	else if(strncasecmp(command,"bajar",5)==0)
		sprintf(resul,"%s %s","get ",&command[6]);
	else if(strncasecmp(command,"pasivo",6)==0)
		sprintf(resul,"%s %s","passive ",&command[7]);
	else if(strncasecmp(command,"activo",6)==0)
		sprintf(resul,"%s %s","active ",&command[8]);
	else if(strncasecmp(command,"salir",5)==0)
		sprintf(resul,"%s %s","quit ",&command[6]);
	else sprintf(resul,"%s",command);
		
}
